from rest_framework.authentication import BaseAuthentication
from rest_framework.exceptions import AuthenticationFailed


class LoginAuth(BaseAuthentication):
    def authenticate(self, request):
        token = request.GET.get('token')
        res = False
        if res:
            return (1,2,3,4)
        else:
            raise AuthenticationFailed('您没有登录')